package com.gxy.learn.design.model.behaviour.observer;

/**
 * @description: 观察者模式测试
 * @author: gaoxueyong
 * @Date: 2022/11/8 18:14
 */
public class Client {
    public static void main(String[] args) {
//        创建公众号
        SubScriptionSubject subScriptionSubject =  new SubScriptionSubject();
//        增加订阅者
        subScriptionSubject.attch(new WeixinUser("唐僧"));
        subScriptionSubject.attch(new WeixinUser("孙悟空"));
        subScriptionSubject.attch(new WeixinUser("猪悟能"));
        subScriptionSubject.attch(new WeixinUser("沙悟净"));
//        发布消息更新
        subScriptionSubject.notify("观察者模式测试！！！");

    }
}
